namespace OasisCiq.XS
{
    using System;

    /// <summary>
    /// The string data type can contain characters, line feeds, carriage returns, and tab characters.
    /// </summary>
    public class XSString
    {
        private readonly string value;

        public XSString(string value)
        {
            if (value == null)
            {
                throw new ArgumentNullException();
            }

            this.value = value;
        }

        public string Value
        {
            get { return value; }
        }

        public static implicit operator XSString(string argument)
        {
            return new XSString(argument);
        }

        public static implicit operator string(XSString argument)
        {
            return argument.Value;
        }

        public override string ToString()
        {
            return value;
        }
    }
}